﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once
#include "IEvent.h"
#include "GbmpQuickCast.h"

namespace gcmp
{
    class IAddinEventHandler;
    class IAddinManager;

    /// \brief 插件事件
    class IAddinEvent : public IEvent
    {
        DEFINE_CAST_DERIVED(gcmp::IAddinEvent, gcmp::IEvent)
    public:
        /// \brief 添加事件处理器
        /// \param pHandler 事件处理器
        /// \return 是否添加成功
        virtual bool Add(IAddinEventHandler* pHandler) = 0;

        /// \brief 删除事件处理器
        /// \param pHandler 事件处理器
        /// \return 是否删除成功
        virtual bool Delete(IAddinEventHandler * pHandler) = 0;

        /// \brief 获取发送者
        /// \return 返回事件发送者
        virtual IAddinManager * GetSender() const = 0;
    };
}
